#ifndef CMD_OTA_H
#define CMD_OTA_H

#include "ota_common.h"

//zigbee -> uart
#define  OTA_CMD_NOTIFY                     0x00
#define  OTA_CMD_NEXT_IMG                   0x01
#define  OTA_CMD_FILE_READ                  0x02
#define  OTA_CMD_STATUS                     0x03

//
typedef struct
{
  osal_event_hdr_t hdr;
  uint8 len;
  uint8 cmd;
  uint8 data[];
} OTA_Msg_t;

typedef struct
{
  uint16 dest;
  uint8 ep;
  uint8 seq;
  uint8 cmd;
} OTA_CnfParam_t;


extern uint8 cmd_OtaFileReadReq( afAddrType_t *pAddr, zclOTA_FileID_t *pFileId,
                                   uint8 size, uint32 offset);

extern uint8 cmd_OtaGetImage( afAddrType_t *pAddr, zclOTA_FileID_t *pFileId,
                                uint16 hwVer, uint8 *ieee, uint8 options );

extern uint8 cmd_OtaSendStatus(afAddrType_t *pAddr, uint8 type, uint8 status, uint8 optional, zclOTA_FileID_t *pFileId);

extern void cmdOta_CmdInput(uint8 cmdSeq, uint8 cmdClass, uint8 cmdLen, uint8* cmdData);

#endif
